<template>
  <div>
    <el-form v-if="editFlag" :model="pluItemInfo" :inline="true" size="small" label-width="280px">
      <el-form-item label="Dept Nbr:">
        <el-input v-model="pluItemInfo.deptNbr" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="Category Nr.:">
        <el-input v-model="pluItemInfo.categoryNbr" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="Category Desc.(English):">
        <el-input v-model="pluItemInfo.englishCategoryDesc" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="Category Desc.(中文):">
        <el-input v-model="pluItemInfo.chineseCategoryDesc" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="Fine line Nr.:">
        <el-input v-model="pluItemInfo.fineLineNbr" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="Fineline Desc.(English):">
        <el-input v-model="pluItemInfo.englishFinelineNbr" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="Fineline Desc.(中文):">
        <el-input v-model="pluItemInfo.chineseFinelineNbr" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="Product Code NBR:">
        <el-input v-model="pluItemInfo.productCodeNbr" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="PLU NBR:">
        <div style="width: 200px;">
          <span class="filter-item">{{ iparent.itemInfo.vendorStockId }}</span>
        </div>
      </el-form-item>
      <el-form-item label="Plu商品说明中文说明:">
        <el-input v-model="pluItemInfo.pluDesc" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="新建商品说明:">
        <el-input v-model="pluItemInfo.newItemDesc" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="New 归类描述:">
        <el-input v-model="pluItemInfo.newClassifyDesc" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="Plu Desc 3 商品描述:">
        <el-input v-model="pluItemInfo.pluDesc3" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="规格:">
        <el-input v-model="pluItemInfo.sizeDesc" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="Shelf Life 最佳食用期:">
        <el-input v-model="pluItemInfo.shelfLife" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="Tare Weight 皮重:">
        <el-input v-model="pluItemInfo.tareWeight" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="Fixed Weight N表示称重/Y表示非秤重:">
        <el-input v-model="pluItemInfo.fixedWeight" size="mini" style="width: 200px;" class="filter-item" />
      </el-form-item>
      <el-form-item label="配料表:">
        <div style="width: 700px;">
          <el-input v-model="pluItemInfo.chargeMixtureForm" size="mini" type="textarea" placeholder="只用于店内自制和加工商品,供应商直送门店销售商品不可以用配料表,有配料表的PLU也可以用于供应商品,必须通知店面用小号标签打印标签）供应商直送商品,请尽量要求用店内码,按份销售。" :rows="3" class="filter-item" />
        </div>
      </el-form-item>
      <el-form-item label="备注:">
        <div style="width: 700px;">
          <el-input v-model="pluItemInfo.remark" size="mini" type="textarea" :rows="3" class="filter-item" />
        </div>
      </el-form-item>
    </el-form>
    <el-button v-if="!editFlag && iparent.parent.readOnly !== true && (iparent.itemStatus === 2 || iparent.itemStatus === -4 || iparent.itemStatus === -10 || iparent.itemStatus === -6 || iparent.itemStatus === -11)" size="mini" type="primary" round @click="doAddPlu">新增</el-button>
  </div>
</template>

<script>
export default {
  props: {
    iparent: {
      type: Object,
      default: null
    }
  },
  data() {
    return {
      pluItemInfo: {},
      editFlag: false
    }
  },
  methods: {
    doAddPlu() {
      this.pluItemInfo.pluNbr = this.iparent.itemInfo.vendorStockId
      this.iparent.itemInfo.pluItemInfo = this.pluItemInfo
      this.editFlag = true
    }
  }
}
</script>
